
import { rbacRoleAdd, rbacRoleDelete, rbacRoleUpdate, rbacRoleQuery, rbacRoleAddRoleMenu, rbacRoleQueryMenuByRole } from '@/api/roleController'

const state = {}
const mutations = {}
const actions = {
  // 新增角色
  async rbacRoleAdd(...rest) {
    const result = await rbacRoleAdd(rest[1])
    return result
  },
  // 删除角色
  async rbacRoleDelete(...rest) {
    const result = await rbacRoleDelete(rest[1])
    return result
  },
  // 更新角色
  async rbacRoleUpdate(...rest) {
    const result = await rbacRoleUpdate(rest[1])
    return result
  },
  // 查询全部角色
  async rbacRoleQuery(...rest) {
    const result = await rbacRoleQuery(rest[1])
    return result
  },
  // 绑定角色(id)和菜单(id)之间的关系【包括新增更新】
  async rbacRoleAddRoleMenu(...rest) {
    const result = await rbacRoleAddRoleMenu(rest[1])
    return result
  },
  // 根据角色(id)查询关联菜单
  async rbacRoleQueryMenuByRole(...rest) {
    const result = await rbacRoleQueryMenuByRole(rest[1])
    return result
  }

}
const getters = {}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
